package com.wg.msproductgz.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wg.msproductgz.entity.ProductspecValue;
import com.wg.msproductgz.mapper.ProductspecValueMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductspecValueService extends ServiceImpl<ProductspecValueMapper, ProductspecValue> {
    @Autowired
    private ProductspecValueMapper productspecValueMapper;
    public List<ProductspecValue> select(ProductspecValue productspecValue)
        {
            QueryWrapper<ProductspecValue> queryWrapper=new QueryWrapper<>();
            if (productspecValue.getId()!=null){
                queryWrapper.eq("id",productspecValue.getId());
            } else if (productspecValue.getSpecId()!=null) {
                queryWrapper.eq("spec_id",productspecValue.getSpecId());
            } else if (productspecValue.getValue()!=null) {
                queryWrapper.eq("value",productspecValue.getValue());
            }
            return productspecValueMapper.selectList(queryWrapper);
        }
}
